package com.haulmont.asu.web.ui.faculty;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 23.10.13 12:23
 */
public class FacultyBrowser extends AbstractLookup {

    @Inject
    protected Table facultiesTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        facultiesTable.removeAction(getAction("facultiesTable.create"));
        facultiesTable.addAction(new CreateAction(facultiesTable, WindowManager.OpenType.DIALOG));

        facultiesTable.removeAction(getAction("facultiesTable.edit"));
        facultiesTable.addAction(new EditAction(facultiesTable, WindowManager.OpenType.DIALOG));
    }
}
